import 'package:flutter/material.dart';
import 'package:test_flutter/utils/ColorsUtil.dart';
import 'package:test_flutter/utils/factory/Fit.dart';

class LineItem extends StatefulWidget {
  final String title;
  final String img;
  final String secondeTitle ;
  final GestureTapCallback onTap;
  LineItem({this.img='',this.title, this.onTap,this.secondeTitle = ''});

  @override
  LineItemState createState() => new LineItemState();
}

class LineItemState extends State<LineItem> {
  @override
  Widget build(BuildContext context) {
    return new SizedBox(
      width: Fit.scaleX(1080),
      height: Fit.scaleY(180),
      child: Material(
        color: Colors.white,
        child: InkWell(
          onTap: widget.onTap,
          child: Container(
            child: new Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                SizedBox(
                    width: Fit.scaleX(100),
                    height: Fit.scaleY(100),
                    child: Container(
                        padding: EdgeInsets.only(left: 10.0),
                        child: Image.asset(widget.img))),
                Container(
                    padding: EdgeInsets.only(left: Fit.scaleX(20)),
                    child: Text(widget.title,
                        style: TextStyle(color: ColorsUtil.fontColor))),
                Expanded(
                    child: Container(
                  padding: EdgeInsets.only(right: Fit.scaleX(40)),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.end,
                    children: <Widget>[
                      Text(widget.secondeTitle,
                          style: TextStyle(color: ColorsUtil.fontColor)),
                      SizedBox(
                          width: Fit.scaleX(70),
                          height: Fit.scaleY(70),
                          child: Image.asset('images/arrow.png')),
                    ],
                  ),
                ))
              ],
            ),
          ),
        ),
      ),
    );
  }
}
